// 普通提示
function show(msg = "获取成功",icon = 'none',time = 2000) {
	uni.showToast({
		title: msg,
		icon: icon,
		duration:time
	})
}

// 成功提示
function success(msg = '保存成功',icon = 'success',time = 2000) {
	uni.showToast({
		title: msg,
		icon: icon,
		duration:time
	})
}

//失败提示
function error(msg = '操作失败',icon = 'none',time = 2000) {
	uni.showToast({
		title: msg,
		icon: icon,
		duration:time
	})
}

// 加载中
function loading(msg = "正在加载！") {
	uni.showLoading({
		title: msg,
		mask: true
	})
}
// 加载结束
function loadHide() {
	setTimeout(function () {
	    uni.hideLoading();
	}, 1500);
}



// 成功并返回上一页
function successJump(msg = '操作成功', delta = 1,icon = 'success',time = 2000) {
	uni.showToast({
		title: msg,
		icon: icon,
		duration:time
	})
	setTimeout(() => {
		uni.navigateBack({
			delta
		});
	}, 1000)
}



export default {
	show,
	success,
	error,
	successJump,
	loading,
	loadHide
}